using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace EFDataBase.Models.Mapping
{
    public class managerMap : EntityTypeConfiguration<manager>
    {
        public managerMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.username)
                .HasMaxLength(50);

            this.Property(t => t.phone)
                .HasMaxLength(50);

            this.Property(t => t.user_type)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.password)
                .HasMaxLength(150);

            this.Property(t => t.state)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("manager");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.username).HasColumnName("username");
            this.Property(t => t.phone).HasColumnName("phone");
            this.Property(t => t.user_type).HasColumnName("user_type");
            this.Property(t => t.password).HasColumnName("password");
            this.Property(t => t.createtime).HasColumnName("createtime");
            this.Property(t => t.state).HasColumnName("state");
        }
    }
}
